package com.comac.print.component.app.gatewayimpl.print;

import com.comac.print.component.app.domain.gateway.enums.MpStatusEnum;
import com.comac.print.component.app.domain.gateway.print.MasterPlateGateway;
import com.comac.print.component.app.domain.gateway.printE.MasterPlateE;
import com.comac.print.component.app.gatewayimpl.database.dataobject.MasterPlateDO;
import com.comac.print.component.app.gatewayimpl.database.mapper.MasterPlateMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

import static cn.hutool.core.date.DateTime.now;


@Component
public class MasterPlateGatewayImpl implements MasterPlateGateway {

    @Resource
    private MasterPlateMapper masterPlateMapper;

    @Override
    public void create(MasterPlateE masterPlate) {
        MasterPlateDO masterPlateDO = new MasterPlateDO();
        BeanUtils.copyProperties(masterPlate,masterPlateDO);
        //masterPlateDO.setCreateTime(now());
        //masterPlateDO.setMpStatus(MpStatusEnum.MP_RELEASE.getCode());
        masterPlateMapper.insert(masterPlateDO);
    }
}
